set more off
ssc install grstyle, replace
ssc install coefplot, replace
ssc install conjoint, replace

**Use Muzzling_Long_JOP_23

**********************************
****Figure 1
**********************************

***Prep DVs

gen punish = Pref
recode punish (1=0) (2=1) (3=2) (4=3) (5=4) (98/99=.)

***Prep IVs

gen female = V7

gen poverty = V8
recode poverty (8/9=.)

gen educ = V25
recode educ (98/99=.)

gen age = V6

gen trustpres = V23
recode trustpres (8/9=.)

gen trustopp = V24
recode trustopp (8/9=.)

gen ethnic_nonpres = V26
recode ethnic_nonpres (1=1) (2=0) (3/6=1) (7=0) (8/36=1) (37=0) (38/42=1) (43=0) (44/47=1) (48=0) (49/997=1) (998=.)

ologit punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres i.COU, cluster(subj)
estimates store POOLED_A

grstyle init
grstyle color background white
graph set window fontface "Century Gothic"

label define country2 1 "Côte d'Ivoire" 2 "Kenya" 3 "Nigeria" 4 "Uganda"
label values COU country2

label define Accusation 1 "Independent agency" 2 "The opposition" 3 "The president"
label values AttB Accusation

coefplot POOLED_A, xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

*******************************
****Appendix E
*******************************

**Note: age recoded from continous to ordinal due to empty cells for specific ages in certain countries (18-30) (31-45) (46-60) (61-99)
gen agegp = age
recode agegp (18/30=0) (31/45=1) (46/60=2) (61/99=3)

label variable AttB "Accuser"
label variable AttA "Funding Source"
label variable AttC "Infraction"

conjoint punish AttB AttC AttA female poverty educ agegp ethnic_nonpres trustpres trustopp, est(mm) id(subj)
conjoint punish AttB AttC AttA COU, est(mm) id(subj) h0(2) graph

************************
*****Figure 2
************************

ologit punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==1, cluster(subj)
estimates store CDI_A, title("Côte d'Ivoire")

ologit punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==2, cluster(subj)
estimates store KEN_A, title("Kenya")

ologit punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==3, cluster(subj)
estimates store NIG_A, title("Nigeria")

ologit punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==4, cluster(subj)
estimates store UGA_A, title("Uganda")

coefplot CDI_A, bylabel(Côte d'Ivoire)|| KEN_A, bylabel(Kenya) || NIG_A, bylabel(Nigeria) || UGA_A, bylabel(Uganda)||, xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}") ysize(10) xsize(8)

************************
*****Appendix F
************************

conjoint punish AttB AttC AttA female poverty educ agegp ethnic_nonpres trustpres trustopp, est(mm) id(subj) sub(COU)
conjoint punish AttB AttC AttA, est(mm) id(subj) sub(COU) h0(2) graph

************************
****Figure 3
************************

ologit punish i.AttB i.AttC i.AttA female poverty educ age ethnic_nonpres i.COU if trustpres>1, cluster(subj)
estimates store POOLED_TrustPres, title("Trust president")

ologit punish i.AttB i.AttC i.AttA female poverty educ age ethnic_nonpres i.COU if trustopp>1, cluster(subj)
estimates store POOLED_TrustOpp, title("Trust opposition")

coefplot (POOLED_TrustPres, msymbol(T) msize(small) label(Trust president)) (POOLED_TrustOpp, msize(small) label(Trust opposition)), xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

************************
*****Appendix G
************************

gen hightrustpres = trustpres
recode hightrustpres (0/1=0) (2/3=1)

gen lowtrustpres = trustpres
recode lowtrustpres (0/1=1) (2/3=0)

gen hightrustopp = trustopp
recode hightrustopp (0/1=0) (2/3=1)

gen lowtrustopp = trustopp
recode lowtrustopp (0/1=1) (2/3=0)

label define trust_di 1 "High" 0 "Low"
label values hightrustopp trust_di
label values hightrustpres trust_di

conjoint punish AttB AttC AttA female poverty educ agegp ethnic_nonpres, est(mm) id(subj) sub(hightrustpres)
conjoint punish AttB AttC AttA, est(mm) id(subj) sub(hightrustpres) graph

conjoint punish AttB AttC AttA female poverty educ agegp ethnic_nonpres, est(mm) id(subj) sub(hightrustopp)
conjoint punish AttB AttC AttA, est(mm) id(subj) sub(hightrustopp) graph

******************************
*****Appendix H
******************************

ologit punish i.AttB i.AttC i.AttA female poverty educ age ethnic_nonpres i.COU if trustpres>1 & trustopp<2, cluster(subj)
estimates store POOLED_TrustPresOpp, title("Trust president & distrust opposition")

ologit punish i.AttB i.AttC i.AttA female poverty educ age ethnic_nonpres i.COU if trustopp>1 & trustpres<2, cluster(subj)
estimates store POOLED_TrustOppPres, title("Trust opposition & distrust president")

coefplot (POOLED_TrustPresOpp, msymbol(T) msize(small) label(Trust pres/dis opp)) (POOLED_TrustOppPres, msize(small) label(Trust opp/dis pres)), xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

*****************************
*****Appendix I
******************************

ologit punish i.AttB i.AttC i.AttA female poverty educ age ethnic_nonpres i.COU if trustpres==3 & trustopp==0, cluster(subj)
estimates store POOLED_TrustPresOppPol, title("Max polarization/pro-pres")

ologit punish i.AttB i.AttC i.AttA female poverty educ age ethnic_nonpres i.COU if trustpres==0 & trustopp==3, cluster(subj)
estimates store POOLED_TrustOppPresPol, title("Max polarization/pro-opp")

coefplot (POOLED_TrustPresOppPol, msymbol(T) msize(small) label(Max (pro-pres))) (POOLED_TrustOppPresPol, msize(small) label(Max (pro-opp))), xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

**50% of vignettes with this infraction yielded calls for shutdowns, with 31% permanent.

tab punish if AttC==4
disp 19.41+30.89

***only 8% of all vignettes referencing bias yielded responses that supported no punishment--but they do see it as a lower-order concern (58% yielded calls for warnings)

tab punish if AttC==3

***The majority response for vignettes with both types of MDM (53% for COVID, 52% for candidates) was a warning, but very few (4% and 5%, respectively) yielded calls for no response

tab punish if AttC==2
tab punish if AttC==5

***only 4% of respondes called for no punishment at all

gen punish_di = punish
recode punish_di (0=0) (1/4=1)
tab punish_di

***Across vignettes, the most-common recommendation was for a written fine; 49% of all vignettes yielded such a response...18% of vignettes produced calls for a fine, 16% for a temporary shutdown, and 13% for a permanent shutdown

tab punish

****************************
***Appendix J
****************************

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp i.COU if ethnic_nonpres==1, cluster(subj)
estimates store noncoeth, title ("Non-coethnic of Pres")

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp i.COU if ethnic_nonpres==0, cluster(subj)
estimates store coeth, title ("Coethnic of Pres")

coefplot (noncoeth, msymbol(T) msize(small) label(Non-coethnic of pres)) (coeth, msize(small) label(Coethnic of pres)), xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

label define coethnic 1 "Noncoethnic of Pres" 0 "Coethnic"
label values ethnic_nonpres coethnic

conjoint punish AttB AttC AttA female poverty educ agegp trustpres trustopp COU, est(mm) id(subj) sub(ethnic_nonpres)
conjoint punish AttB AttC AttA COU, est(mm) id(subj) sub(ethnic_nonpres) graph

****************
***Appendix K
****************

ologit punish i.AttB i.AttC i.AttA if COU==1, cluster(subj)
estimates store CDI_B, title("Côte d'Ivoire")

ologit punish i.AttB i.AttC i.AttA if COU==2, cluster(subj)
estimates store KEN_B, title("Kenya")

ologit punish i.AttB i.AttC i.AttA if COU==3, cluster(subj)
estimates store NIG_B, title("Nigeria")

ologit punish i.AttB i.AttC i.AttA if COU==4, cluster(subj)
estimates store UGA_B, title("Uganda")

ologit punish i.AttB i.AttC i.AttA i.COU, cluster(subj)
estimates store POOLED_B

coefplot POOLED_B, xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

coefplot CDI_B, bylabel(Côte d'Ivoire)|| KEN_B, bylabel(Kenya) || NIG_B, bylabel(Nigeria) || UGA_B, bylabel(Uganda)||, xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}") ysize(10) xsize(8)

*************************************
*****Appendix L
*************************************

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==1, cluster(subj)
estimates store CDI_Areg, title("Côte d'Ivoire")

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==2, cluster(subj)
estimates store KEN_Areg, title("Kenya")

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==3, cluster(subj)
estimates store NIG_Areg, title("Nigeria")

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres if COU==4, cluster(subj)
estimates store UGA_Areg, title("Uganda")

reg punish i.AttB i.AttC i.AttA female poverty educ age trustpres trustopp ethnic_nonpres i.COU, cluster(subj)
estimates store POOLED_Areg

coefplot POOLED_Areg, xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}" 1.COU = "{bf:Country}")

coefplot CDI_Areg, bylabel(Côte d'Ivoire)|| KEN_Areg, bylabel(Kenya) || NIG_Areg, bylabel(Nigeria) || UGA_Areg, bylabel(Uganda)||, xline(0) level(95) omitted baselevels drop(_cons female poverty educ age trustpres trustopp ethnic_nonpres) coeflabels(1.AttC = "Not paying taxes" 2.AttC = "Lies about candidates" 3.AttC = "Partisan bias" 4.AttC = "Supporting armed groups" 5.AttC = "COVID falsehoods" 6.AttC = "Hate speech") headings( 1.AttA = "{bf:Funding source}" 1.AttB = "{bf:Accuser}" 1.AttC = "{bf:Infraction}") ysize(10) xsize(8)